import React, { Component, createRef } from 'react'


export default class App extends Component {
  state = {
    age: 18,
    bBar: true
  }
  handleclick=() => {
    this.setState({
      age:this.state.age +1 
    })
    this.setState({
      age:this.state.age +2
    })
    this.setState({
      age:this.state.age +3
    })
    console.log(this.state.age);
  }
  render () {
    return (
      <div>
       <p>{this.state.age}</p>
       <button onClick={this.handleclick}>clcick</button>
      </div >
    )
  }

  componentDidUpdate () {
    // console.log('2，componentDidUpdate')
    // console.log(document.querySelector('span').innerHTML)
  }
}
